package com.hpf.springcloud.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @description:
 * @datetime: 2020/8/22 21:37
 * @author: huangpengfei
 */
@RestController
@Slf4j
public class PaymentController {

    @Autowired
    private RestTemplate restTemplate;

    public static final String SERVICE_URL = "http://cloud-payment-consul-service";

    @GetMapping("/consumer/payment/consul")
    public String consumerConsul(){
        return restTemplate.getForObject(SERVICE_URL + "/payment/consul",String.class);
    }
}
